﻿using System;
using System.Xml.Linq;

namespace EHR.Ctrls.QueryDesign
{
    public class OrderByInfo : IXmlItem
    {
        public string FieldName { get; set; }

        public bool IsAsc { get; set; }


        public XElement ToXml()
        {
            XElement el = new XElement("OrderBy",
                new XAttribute("FieldName", FieldName),
                new XAttribute("IsAsc", IsAsc));
            return el;
        }

        public void FromXml(XElement el)
        {
            FieldName = el.Attribute("FieldName").Value;
            IsAsc = bool.Parse(el.Attribute("IsAsc").Value);
        }
    }
}
